home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / demos / 139 / geniedl.ap < prev    next >
Encoding:
Text File  |  1988-03-03  |  5.1 KB  |  124 lines

  1. |
  2. | ST-Talk Pro AutoPilot script for Genie Downloading        mod 3/2/88 jsd
  3. |_____________________________________________________________________________
  4. Clear                       | Erase variables
  5. Trace off                   | Trace mode off
  6.                             |
  7. dlfiles=""                  | Init String type variable to hold file names
  8. Array dlfiles 10            | Declare storage for upto 10 file names
  9. Array dlnums 10             | Declare storage for upto 10 file numbers
  10.                             |
  11. dlmax=1                     | Set this for the number of files to DL
  12.                             | Fill in the file names and numbers.......
  13. |___________________________|_________________________________________________
  14. dlfiles[1]=     "f:test"
  15. dlnums[1] =      390
  16. dlfiles[2]=""
  17. dlnums[2] =0
  18. dlfiles[3]=""
  19. dlnums[3] =0
  20. dlfiles[4]=""
  21. dlnums[4] =0
  22. dlfiles[5]=""
  23. dlnums[5] =0
  24. dlfiles[6]=""
  25. dlnums[6] =0
  26. dlfiles[7]=""
  27. dlnums[7] =0
  28. dlfiles[8]=""
  29. dlnums[8] =0
  30. dlfiles[9]=""
  31. dlnums[9] =0
  32. dlfiles[10]=""
  33. dlnums[10] =0
  34.  
  35. |Log on and get to Atari ST RT download area. Run from dialer after dial.
  36. |____________________________________________________________________________
  37. IF connect                              | Double check carrier detect
  38.     Capture 2                           | turn capture on to buffer 2
  39.     Print "~Logging on to Genie...~~"   | Show what we're doing
  40.     IF not Wait 30 "U#="                | Wait for logon prompt
  41.         GOTO logerror                   |   error, abort!
  42.     ENDIF                               | Put your account/password here...
  43.     Printm "^Rxxx11111,password,476;6~" | Send user id and go to ST RT & DL
  44. ELSE                                    |
  45.     GOTO logerror                       | no carrier detect, abort.
  46. ENDIF                                   | continue with DL after function def
  47.  
  48. |============================================================================
  49. |Define User-function DLone |
  50. |___________________________|
  51. @DLone                      | Create a user function to download one file
  52.                             | Inputs fileanem from dlfile and number from dlnum
  53.     error=true              |   Assume there was an error
  54.     IF not Wait 90 "file?"  | Wait for file? prompt
  55.         GOTO DLerror        |   nope, error!
  56.     ENDIF                   |
  57.     Printm dlnum            | Send the file number
  58.     Printm "~"              | Send a return
  59.     IF not Wait 90 "<Q>uit" | Wait for Quit etc prompt
  60.         GOTO DLerror        |   nope, error!
  61.     ENDIF                   |
  62.     Printm "D~"             | Send D for Download and a return
  63.     IF not Wait 90 "receive"| Wait for receive prompt
  64.         GOTO DLerror        |   nope, error!
  65.     ENDIF                   |
  66.     Flush 30                | 
  67.     Print "~~Downloading #" | Display status...
  68.     Print dlnum             |
  69.     Print ", "              |
  70.     Print dlfile            |
  71.     Print "... "            |
  72.     Download 2 dlfile       | Do the download of the filename in dlfile
  73.     IF not Wait 90 ">?"     | Wait for ? prompt
  74.         GOTO DLerror        |   nope, error!
  75.     ENDIF                   |
  76.     Print "Done.~"          | Display status
  77.     Printm "~"              | Send a return
  78.     IF not Wait 90 ")?"     | Wait for ? prompt
  79.         GOTO DLerror        |   nope, error!
  80.     ENDIF                   |
  81.     Printm "Y~"             | Send Y and a return, ready for next file
  82.     error=false             | No error if we made it this far
  83. _DLerror                    | Exit here for errors
  84. @endsub                     |End of DLone
  85. |___________________________|_________________________________________________
  86.  
  87. |
  88. | Main loop to download the array of files
  89. |_____________________________________________________________________________
  90.  
  91. count=1                     | Start at first file
  92. _DLloop                     | Start downloading file list...
  93. IF count<=dlmax             | Are there more files?
  94.     dlnum = dlnums[count]   | Yes, get the file's number
  95.     dlfile = dlfiles[count] | and get its name
  96.     DLone                   | download the file
  97.     IF error=true           | Was there an error?
  98.         GOTO bigerror       | Yes, end!
  99.     ENDIF                   | No...
  100.     count = count + 1       | Increment the file count
  101.     GOTO DLloop             | Do another file.
  102. ENDIF                       |
  103.                             | End of main Loop
  104. Wait 90 "file?"             | Wait for file? prompt
  105. Printm "~"                  | No more files.
  106. Print "Done Downloading!~"  | Hey, we're done!
  107. Capture 0                   | turn capture off
  108. IF not Wait 90 "<H>elp?"    | Wait for prompt
  109.     GOTO bigerror           |   nope, error!
  110. ENDIF                       |
  111. QUIT                        | and quit (or do some more smart stuff)
  112. |___________________________|
  113.  
  114.  
  115. _bigerror                   | Go here upon Control errors!
  116. Print "Error!~"             | Say this was bad.
  117. Capture off
  118. QUIT
  119.  
  120. _logerror                   | Go here upon bad log on!
  121. Print "Error logging on!~"  | Show status for this.
  122. Capture off
  123. QUIT